package com.tfswx.ruleengine.database.dao;

import com.tfswx.ruleengine.compute.bean.FfItem;
import com.tfswx.ruleengine.compute.bean.GzDataDTO;
import com.tfswx.ruleengine.compute.bean.RuleInfo;
import com.tfswx.ruleengine.database.dto.RuleInfoListQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Ricky
 * @date 2021/6/10
 */
@Mapper
public interface GzyqMapper {
    void execute(@Param("sql") String sql);

    /**
     * 根据gzflbs获取规则列表
     *
     * @param ruleInfoListQueryParam ruleInfoListQueryParam
     * @return java.util.List<com.tfswx.ruleengine.compute.bean.RuleInfo>
     * @author Ricky
     * @date 2021/6/11
     */
    List<RuleInfo> queryRuleInfoList(RuleInfoListQueryParam ruleInfoListQueryParam);


    /**
     * 导入规则分类
     *
     * @param gzfl gzfl
     * @return int
     * @author Ricky
     * @date 2021/6/11
     */
    int importGzfl(GzDataDTO.Gzfl gzfl);

    /**
     * 导入规则定义
     *
     * @param gzdy gzdy
     * @return int
     * @author Ricky
     * @date 2021/6/11
     */
    int importGzdy(GzDataDTO.Gzdy gzdy);

    /**
     * 导入表达式
     *
     * @param bds bds
     * @return int
     * @author Ricky
     * @date 2021/6/11
     */
    int importBds(GzDataDTO.Bds bds);

    /**
     * 批量导入规则分类
     *
     * @param gzflList gzflList
     * @return int
     * @author Ricky
     * @date 2021/6/11
     */
    int importGzflList(List<GzDataDTO.Gzfl> gzflList);

    /**
     * 批量导入规则定义
     *
     * @param gzdyList gzdyList
     * @return int
     * @author Ricky
     * @date 2021/6/11
     */
    int importGzdyList(List<GzDataDTO.Gzdy> gzdyList);

    /**
     * 批量导入表达式
     *
     * @param bdsList bdsList
     * @return int
     * @author Ricky
     * @date 2021/6/11
     */
    int importBdsList(List<GzDataDTO.Bds> bdsList);

    String getDatabaseId();

    List<GzDataDTO.Gzfl> exportGzflListByXmbm(@Param("xmbm") String xmbm);

    List<GzDataDTO.Mxstgx> exportMxstgxListByXmbm(@Param("xmbm") String xmbm);

    int importMxstgxList(List<GzDataDTO.Mxstgx> mxstgxList);

    // @Results(value = {
    //         @Result(column = "classdata", property = "classdata", javaType = byte[].class, jdbcType = JdbcType.BLOB, typeHandler = BlobTypeHandler.class),
    // })
    List<FfItem> queryFnList();

    int importFfList(List<GzDataDTO.Ff> ffList);

    List<GzDataDTO.Ff> exportFfList();
}
